package com.bao.interkont.mapper;

import com.bao.interkont.pojo.Comment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author bao*
 * @version 1.0
 */
@Mapper
public interface CommentMapper {
    @Insert("insert into comment(uid,article_id,content) value(#{uid},#{articleId},#{content})")
    void addComment(Comment comment);

    @Select("select * from comment where article_id = #{articleId}")
    List<Comment> getComments(@Param(value = "articleId") Integer articleId);
}
